﻿#region Header Licence
//  NKnobMan, Copyright 2009, Alexandre MUTEL.
// 
//  This is free software; you can redistribute it and/or modify it
//  under the terms of the GNU Lesser General Public License as
//  published by the Free Software Foundation; either version 2.1 of
//  the License, or (at your option) any later version.
// 
//  This software is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
//  Lesser General Public License for more details.
// 
//  You should have received a copy of the GNU Lesser General Public
//  License along with this software; if not, write to the Free
//  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
//  02110-1301 USA, or see the FSF site: http://www.fsf.org.
#endregion
using System;
using System.Linq;
using NKnobMan;

namespace KnobManTester
{
    class Program
    {
        static void Main(string[] args)
        {
            KnobMan knobMan = KnobMan.Default;
            if (knobMan == null)
                return;

            // Iterate on Layers
            foreach (Layer layer in knobMan.Layers)
            {
                Console.Out.WriteLine("Layer #{0}", layer.Id);
                Console.Out.WriteLine("     Layout: {0}", layer.Layout);
                Console.Out.WriteLine("     Colors: {0}", layer.Colors);
                Console.Out.WriteLine("     Mask: {0}", layer.Mask);
                Console.Out.WriteLine("     Lighting: {0}", layer.Lighting);
            }

            // Find layers with an alpha From value > 50
            var list = from layer in knobMan.Layers
                       where layer.Colors.Alpha.From > 50 
                       select layer;

            Console.Out.WriteLine("Layers with a Colors.Alpha.From > 50");
            foreach (Layer layer in list)
            {
                Console.Out.WriteLine("    Layer #{0} Colors.Alpha.From = {1}", layer.Id,layer.Colors.Alpha.From);
            }

            Console.Out.WriteLine("Press enter to close this");
            Console.In.ReadLine();
        }
    }
}
